import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children: [
      {
        path: '/fruit',
        name: 'Fruit',
        component: () => import('@/views/fruit')
      },
      {
        path: '/vegetables',
        name: 'Vegetables',
        component: () => import('@/views/vegetables')
      },
      {
        path: '/meat',
        name: 'Meat',
        component: () => import('@/views/meat')
      },
      {
        path: '/seafood',
        name: 'Seafood',
        component: () => import('@/views/seafood')
      },
      {
        path: '/drink',
        name: 'Drink',
        component: () => import('@/views/drink')
      },
    ]
  },
  {
    path: '/',
    name: 'Search',
    component: () => import('@/views/search')
  },
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
